# 鉴权类
from rest_framework.permissions import BasePermission


class UserPremission(BasePermission):
    '''
    鉴权类
    '''
    # 对请求资源的鉴权
    message='当前用户权限不允许访问此资源'
    def has_permission(self, request, view):
        # if request.user.get('groupid') != 3:
        #    return False
        # TODO:
        return True

    # 对数据资源的鉴权 一般用不到
    def has_object_permission(self, request, view, obj):
        return True
